﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace VehicleScale.Models
{
    public class VehicleScaleDetailModel : ModelBase
    {
        #region Properties
        private int _order = 0;
        public int Order
        {
            get { return _order; }
            set
            {
                if (this._order != value)
                {
                    this._order = value;
                }
            }
        }

        private System.Guid _vehicleScaleDetailID;
        public System.Guid VehicleScaleDetailID
        {
            get
            {
                return this._vehicleScaleDetailID;
            }
            set
            {
                if ((this._vehicleScaleDetailID != value))
                {
                    this._vehicleScaleDetailID = value;
                }
            }
        }

        private string _vehicleScaleID;
        public string VehicleScaleID
        {
            get
            {
                return this._vehicleScaleID;
            }
            set
            {
                if ((this._vehicleScaleID != value))
                {
                    this._vehicleScaleID = value;
                }
            }
        }

        private string _vehicleID;
        public string VehicleID
        {
            get
            {
                return this._vehicleID;
            }
            set
            {
                if ((this._vehicleID != value))
                {
                    this._vehicleID = value;
                }
            }
        }

        private decimal _firstWeight;
        public decimal FirstWeight
        {
            get
            {
                return this._firstWeight;
            }
            set
            {
                if ((this._firstWeight != value))
                {
                    this._firstWeight = value;
                }
            }
        }

        private decimal _secondWeight;
        public decimal SecondWeight
        {
            get
            {
                return this._secondWeight;
            }
            set
            {
                if ((this._secondWeight != value))
                {
                    this._secondWeight = value;
                }
            }
        }

        public decimal TotalWeight
        {
            get
            {
                return Math.Abs(this._secondWeight - this._firstWeight);
            }
        }

        public decimal TotalActualWeight
        {
            get
            {
                return this._secondWeight - this._firstWeight;
            }
        }

        private VehicleScaleModel _vehicleScale;
        public VehicleScaleModel VehicleScale
        {
            get { return _vehicleScale; }
            set
            {
                if (_vehicleScale != value)
                {
                    _vehicleScale = value;
                }
            }
        }

        private DateTime _scaleTime1;
        public DateTime ScaleTime1
        {
            get { return _scaleTime1; }
            set
            {
                if (_scaleTime1 != value)
                {
                    _scaleTime1 = value;
                }
            }
        }

        private DateTime _scaleTime2;
        public DateTime ScaleTime2
        {
            get { return _scaleTime2; }
            set
            {
                if (_scaleTime2 != value)
                {
                    _scaleTime2 = value;
                }
            }
        }

        public bool HasFirstWeight 
        {
            get { return _firstWeight > 0; }
        }

        public bool HasSecondWeight
        {
            get { return _secondWeight > 0; }
        }

        #region Reports
        private string _vehicleID2 = String.Empty;
        public string VehicleID2
        {
            get
            {
                return this._vehicleID2;
            }
            set
            {
                if ((this._vehicleID2 != value))
                {
                    this._vehicleID2 = value;
                }
            }
        }

        private decimal _firstWeight2;
        public decimal FirstWeight2
        {
            get
            {
                return this._firstWeight2;
            }
            set
            {
                if ((this._firstWeight2 != value))
                {
                    this._firstWeight2 = value;
                }
            }
        }

        private decimal _secondWeight2;
        public decimal SecondWeight2
        {
            get
            {
                return this._secondWeight2;
            }
            set
            {
                if ((this._secondWeight2 != value))
                {
                    this._secondWeight2 = value;
                }
            }
        }

        private string _vehicleID3 = String.Empty;
        public string VehicleID3
        {
            get
            {
                return this._vehicleID3;
            }
            set
            {
                if ((this._vehicleID3 != value))
                {
                    this._vehicleID3 = value;
                }
            }
        }

        private decimal _firstWeight3;
        public decimal FirstWeight3
        {
            get
            {
                return this._firstWeight3;
            }
            set
            {
                if ((this._firstWeight3 != value))
                {
                    this._firstWeight3 = value;
                }
            }
        }

        private decimal _secondWeight3;
        public decimal SecondWeight3
        {
            get
            {
                return this._secondWeight3;
            }
            set
            {
                if ((this._secondWeight3 != value))
                {
                    this._secondWeight3 = value;
                }
            }
        }

        private decimal _editedFirstWeight;
        public decimal EditedFirstWeight
        {
            get
            {
                return this._editedFirstWeight;
            }
            set
            {
                if ((this._editedFirstWeight != value))
                {
                    this._editedFirstWeight = value;
                }
            }
        }

        private decimal _editedSecondWeight;
        public decimal EditedSecondWeight
        {
            get
            {
                return this._editedSecondWeight;
            }
            set
            {
                if ((this._editedSecondWeight != value))
                {
                    this._editedSecondWeight = value;
                }
            }
        }

        private int _numberEdited;
        public int NumberEdited
        {
            get
            {
                return this._numberEdited;
            }
            set
            {
                if ((this._numberEdited != value))
                {
                    this._numberEdited = value;
                }
            }
        }

        private int _numberEdited2;
        public int NumberEdited2
        {
            get
            {
                return this._numberEdited2;
            }
            set
            {
                if ((this._numberEdited2 != value))
                {
                    this._numberEdited2 = value;
                }
            }
        }

        private int _numberEdited3;
        public int NumberEdited3
        {
            get
            {
                return this._numberEdited3;
            }
            set
            {
                if ((this._numberEdited3 != value))
                {
                    this._numberEdited3 = value;
                }
            }
        }

        private DateTime _createdDate;
        public DateTime CreatedDate
        {
            get { return _createdDate; }
            set
            {
                if (_createdDate != value)
                {
                    _createdDate = value;
                }
            }
        }
        #endregion
        #endregion
    }
}
